package shape2D;

import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.layout.Pane;
import javafx.scene.paint.Color;
import javafx.scene.shape.CubicCurve;
import javafx.scene.shape.QuadCurve;
import javafx.stage.Stage;

// 曲线
public class CurveDemo extends Application {
	private Pane root = new Pane();
	private QuadCurve qc;
	private CubicCurve cc;
	
	public static void main(String[] args) {
		launch(args);
	}
	
	@Override
	public void start(Stage stage) throws Exception {
		
		qc = new QuadCurve(10, 200, 100, 50, 200, 200);		// 控制点即斜率为0的点
		qc.setStroke(Color.PURPLE);
		qc.setFill(Color.TRANSPARENT); 		// 透明
		
		cc = new CubicCurve(250, 250, 300, 150, 400, 350, 500, 250);	// 两个控制点
		cc.setStroke(Color.YELLOW);
		root.getChildren().addAll(qc, cc);
		
		Scene scene = new Scene(root, 600, 400);
		stage.setScene(scene);
		stage.show();
	}
}
